{{ define "admin/article_list.html" }}
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>发布</title>
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="keywords" content="">
		<meta name="description" content="">
		<link rel="stylesheet" href="/static/layui/css/layui.css">
		<link rel="stylesheet" href="/static/css/global.css">
		<style>
			.fly-list .fly-list-li {height: 40px;padding: 10px 0 10px 5px;}
		</style>
	</head>
	<body>

		{{template "public/page_header.html" .}}


		<div class="main layui-clear">
			<div class="wrap   ">
				<div class="content" style="margin-right:0">
					{{$cat_query := .cat_query}} 
					<ul class="fly-list">
					{{range $key,$value := .articles}}
						<li class="fly-list-li">

							<h2 class="fly-tip">
								<a href="/content/{{$value.id}}">{{$value.title}}</a>
							</h2>
							<div class="fly-badge">
								<a class="layui-badge layui-bg-blue" href="/admin/article/edit/{{$value.id}}">编辑</a>
								{{if eq $value.hot "1"}}
								<span class="layui-badge layui-bg-black">精贴</span>
								{{end}}
								{{if eq $value.top "1"}}
								<span class="layui-badge layui-bg-red">置顶</span>
								{{end}}
							</div>
							<p class="layui-elip">
								{{if ne $value.catname ""}}
								<span><i class="layui-icon">&#xe612;</i> <a href="/admin/article/list?cat={{$value.cat}}" {{if eq $cat_query $value.cat}}class="layui-badge layui-bg-red"{{end}}>{{$value.catname}}</a></span>
								{{end}}
								{{if ne $value.cat1name ""}}
								<span><i class="layui-icon">&#xe62d;</i> <a href="/admin/article/list?cat={{$value.cat1}}" {{if eq $cat_query $value.cat1}}class="layui-badge layui-bg-red"{{end}}>{{$value.cat1name}}</a></span>
								{{end}}
								{{if ne $value.cat2name ""}}
								<span><i class="layui-icon">&#xe857;</i> <a href="/admin/article/list?cat={{$value.cat2}}" {{if eq $cat_query $value.cat2}}class="layui-badge layui-bg-red"{{end}}>{{$value.cat2name}}</a></span>
								{{end}}
								<span class="fly-list-hint">
									<i class="layui-icon" title="人气">&#xe756;</i> {{$value.post_time}}
									<i class="iconfont" title="回答">&#xe60c;</i> {{$value.clicks}}
								</span>
							</p>
						</li>
					{{end}}


					</ul>


					<div style="text-align: center">
						<div class="laypage-main">
							<span class="laypage-curr">共{{.pages}}页</span>
							<a href="/admin/article/list?page={{.pre}}" class="laypage-next">上一页</a>	
							{{if le .page .pages}}
							<a href="/admin/article/list?page={{.next}}" class="laypage-next">下一页</a>
							{{end}}
							<span class="laypage-curr">当前{{.page}}页</span>
							</div>
					</div>

				</div>
			</div>
		</div>
		{{template "public/page_footer.html" .}}

		{{end}}
